<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/Head.jsp"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="${resourceServer }/css/pintuer.css">
<link rel="stylesheet" href="${resourceServer }/css/admin.css">
<script src="${resourceServer }/js/jquery.js"></script>
<script src="${resourceServer }/js/pintuer.js"></script>
</head>
<body>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>增加品牌</strong>
		</div>
		<div class="body-content">
			<form method="post" class="form-x" enctype="multipart/form-data">
				<div class="form-group">
					<div class="label">
						<label>品牌名：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="" name="name"
							data-validate="required:请输入品牌名" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>图片：</label>
					</div>
					<div class="field">
						<img id="showImg" alt="暂无logo" src="${ imgServer}/${brand.logo}" height="100px" width="200px"><br><br>
						
						  <input type="file" id="logo" name="logoImg" style="display: none"> 
						  <input type="button" class="button bg-blue margin-right" id="image"
							value="上传图片" style="float: left;"> 
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>品牌首页：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="" name="webSite" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>排序：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="" name="sort"
							data-validate="plusinteger:排序必须为数字" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="submit">
							提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<script type="text/javascript">
		$(function() {
			$("#logo").change(function() {
				var fileReader = new FileReader();
				fileReader.onload = function(e) {
					/* $("#url").attr("data-image", e.target.result);
					$("#url").val($("#logo").val()); */
					var a = document.getElementById("showImg");
					a.src = e.target.result;

				}
				fileReader.readAsDataURL($("#logo")[0].files[0]);
			});
			$("#image").click(function() {
				$("#logo").click();
			});
		});
	</script>
</body>
</html>